package com.supereal.bigfile.common;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

/**
 * @Author: DougZ
 * @Date: 2020/11/17 16:21
 * @Description:
 */
@Configuration
public class MutipartConfig {
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
// 单个数据大小
        factory.setMaxFileSize("102400KB"); // 100MB
/// 总上传数据大小
        factory.setMaxRequestSize("10240000KB"); //10g
        return factory.createMultipartConfig();
    }
}
